Skip to content

test(chat): check the renderer warning's anchor against the guide it links to - #3602

Merged
kojiwakayama merged 1 commit into
mainfrom
fix/dx-20260811-r2-8
Aug 11, 2026
Merged

test(chat): check the renderer warning's anchor against the guide it links to#3602
kojiwakayama merged 1 commit into
mainfrom
fix/dx-20260811-r2-8

Conversation

@kojiwakayama

Copy link
Copy Markdown
Contributor

Companion to veryfront/veryfront-docs#371. Dogfooding round 2, finding 8.

The finding, and why the previous fix did not close it

A chat surface without a Markdown renderer logs a warning whose only escape hatch is a deep link. Round 1 fixed the path half of that link -- /docs/guides/chat-ui was a genuine 404, and /docs/code/guides/chat-ui is not. Verification against published 0.1.1229 showed the symptom had only half moved:

$ curl -s https://veryfront.com/docs/code/guides/chat-ui | grep -c render-markdown-in-chat
0

The fragment names no heading on the published page. Unlike a bad path, a bad fragment does not 404 -- the browser silently leaves the reader at the top of the article -- so nothing surfaced it.

The framework's string is not wrong. docs/guides/chat-ui.md, the file that page is published from, has carried ## Render Markdown in chat since #3358. The published page is a 2026-08-02 snapshot that predates it, because veryfront-docs' sync workflow has failed on every run since (details in the docs PR). The content fix belongs in veryfront-docs, and is there. Nothing about the emitted URL needs to change here.

What this changes

The test guarding that link, only.

It asserted the whole URL against a second copy of the same string:

assertEquals(links, ["https://veryfront.com/docs/code/guides/chat-ui#render-markdown-in-chat"]);

That can catch someone editing the constant. It cannot catch someone renaming the heading the fragment names -- the exact drift this finding is about -- because the heading is not part of what it compares. Its doc comment claimed the fragment "has to track the heading in this repo's docs/guides/chat-ui.md", but nothing enforced it.

So resolve the published URL back to the repository file it is published from, and assert the fragment against that file's headings. Same shape as the check #3589 added for error docs links.

Confirmed it fails for the right reason by renaming the heading to what the published page currently has:

AssertionError: no "#render-markdown-in-chat" heading in .../docs/guides/chat-ui.md.
A reader following the warning lands at the top of the article instead of the section.
Headings present: prerequisites, add-the-preset-ui, ..., render-markdown-directly, ...

The doc path resolves from import.meta.url, not the process cwd: test files share one process under --parallel and src/testing/cwd.ts chdirs it. lint:cwd-relative-test-reads passes with no new baseline entry.

Scope

No runtime change, so nothing to verify against a build. The published-artifact proof for this finding is the live page, and it is recorded on the docs PR:

https://veryfront.com/docs/code/guides/chat-ui#render-markdown-in-chat must scroll to a "Render Markdown in chat" heading once veryfront/veryfront-docs#371 is live.

Not fixed here

veryfront-docs' update-reference sync has failed on every run since 2026-08-02, so no code doc merged since then has reached the site. Its quality gate runs after the copy and before the PR, so one non-compliant file blocks delivery of all of them, and the 13 issues it reports live in docs/** in this repository. That is very likely why several round-1 doc fixes never appeared live. It needs its own issue; the offending files are other findings' territory.

…links to

The missing-Markdown-renderer warning deep-links to a section of the chat-ui
guide. The test that guards that link asserted the whole URL against a second
copy of the same string, so it could only catch someone editing the constant --
never someone renaming the heading the fragment names. A fragment that names no
heading does not 404; the reader silently lands at the top of the article, so
nothing else catches it either.

Resolve the published URL back to the repository file it is published from and
assert the fragment against that file's headings. Renaming the section now fails
here, and the failure lists the headings that do exist.

Resolve the doc path from import.meta.url rather than the process cwd: test
files share one process under --parallel and src/testing/cwd.ts chdirs it.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kojiwakayama, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 16 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bc428c5f-f48d-4d92-bfb2-956359d32b30

📥 Commits

Reviewing files that changed from the base of the PR and between 6f30f87 and 99570f1.

📒 Files selected for processing (1)
  • src/react/components/chat/missing-renderer-warning.test.ts

Comment @coderabbitai help to get the list of available commands.

@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit f6de8f8 Aug 11, 2026
59 of 60 checks passed
@kojiwakayama
kojiwakayama deleted the fix/dx-20260811-r2-8 branch August 11, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant